<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>14-案例-未成年人进入网吧</title>
	</head>
	<body>
		<script type="text/javascript">
			var date = prompt('请输入您的出生日期-年');
			//隐式转换
			var birth = 2022-date;
			//判断
			if(birth<18){
				alert("未满18岁,禁止!");
			}else{
				alert("欢迎来玩!");
			}
		</script>
	</body>
</html>
